<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org" >

  <head>
    <title> 게시판 문서 목록 :::::: Spring 기반 게시판 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" media="all" href="../../css/bbs.css" th:href="@{/css/bbs.css}"/>
  </head>

  <body> 
    <div th:include="bbs_header.html::bbs_header"></div>

	<div> 
		<h2>
			<a href="#" th:href="@{ bbsBoardList.con( prevBoardId=${ board.BOARD_ID } ) }" > 게시판 </a>
			 &nbsp;::⇒&nbsp;
			<a href="#" th:href="@{ bbsBoardView.con( boardId=${ board.BOARD_ID } ) }" > 
				<span th:text="${board.BOARD_NAME}"> 게시판 이름 </span>
			</a>
			&nbsp;::⇒&nbsp;
		</h2>
		<fieldset >
			<legend>문서 목록</legend>
			
			<ul class="errorlist">
				<li th:text="${ svrMsg }">메시지</li>
				<li th:if="${ errMsg != null }" th:text="${ errMsg }">에러</li>
				<li><a href="#" th:href="@{ bbsPaperView.con( newPaper=1, boardId=${ BOARD_ID }, paperId=${ -1 } ) }"> 
					<button>새 글 작성</button></a> 
				</li>
			</ul>
		</fieldset>
	</div> 

	<br/>
	
	<div class="entityList" > 
      <table>
        <thead>
          <tr> 
            <th width="50px"	> 번호		</th>
            <th					> 이름		</th>
            <th width="120px"	> 작성자		</th>
			<th width="50px"	> 크기		</th>
			<th width="50px"	> 조회수		</th>
			<th width="138px"	> 수정일		</th>
            <th width="138px"	> 작성일		</th> 
          </tr>
        </thead>
        <tbody>
          <tr th:each=" paper : ${ papers } ">
            <td >
            	<img src="../../img/record_number_icon.png" width="18px" th:src="@{ /img/record_number_icon.png }" align="middle" />
				&nbsp;
				<a href="#" th:href="@{ bbsPaperView.con( boardId=${ BOARD_ID }, paperId=${ paper.PAPER_ID }, paperRno=${ paper.RNO } ) }"  > 
            		<span th:text="${ #numbers.formatInteger( paper.RNO, 3, 'COMMA' ) }">  번호</span>
            	</a>
            </td>
            <td style="text-align: left;"> 
            	<img width="17px" align="middle" src="../../img/paper.png" th:src="@{/img/paper.png}" />
            	&nbsp;
            	<a href="#" th:href="@{ bbsPaperView.con( boardId=${ BOARD_ID }, paperId=${ paper.PAPER_ID }, paperRno=${ paper.RNO } ) }" th:text="${ paper.PAPER_NAME }">
            	문서 이름 
            	</a>
            </td>
			<td style="text-align: left;" >
				<img src="../../img/writer_icon.png" width="22px" th:src="@{ /img/writer_icon.png }" align="middle" />
				&nbsp;
				<span th:text="${ paper.PAPER_USER_NAME }" >
					작성자
				</span>				 		
			</td>
			<td th:text="${ paper.PAPER_CONTENT_SIZE }"		> 크기 		</td>
			<td th:text="${ paper.LOG_PAPER_VIEW_CNT }"		> 조회수 		</td> 
			<td><img width="14px" src="../../img/clock-2x.png" th:src="@{ /img/clock-2x.png }" align="middle" />&nbsp;
				<span th:text="${ paper.PAPER_UPD_DATE }">수정일</span>
			</td> 
			<td><img width="14px" src="../../img/clock-2x.png" th:src="@{ /img/clock-2x.png }" align="middle" />&nbsp;
				<span th:text="${ paper.PAPER_CRE_DATE }">작성일</span>
			</td> 
          </tr>
          <tr th:if="${ papers.size() lt 10 }" th:each="i : ${ #numbers.sequence( papers.size() + 1  , 10 ) } ">
          	<td> &nbsp; </td>
          	<td></td>
          	<td></td>
          	<td></td>
          	<td></td>
          	<td></td>
          	<td></td>
          </tr> 
        </tbody>
		<tfoot>
			<tr >
				<td colspan="1"  > 
					총 <span th:text="${ papers.size() }" >1235</span> 건   
				</td>  
				<td colspan="6"  style="text-align: right;">  
					<div class="pageList">
						<span th:each=" page: ${ papers.pageList } ">
							<a  th:if="${ page.enabledPage }"
								class="" th:class="${ page.currentPage ? 'activePage' : '' }" 
								href="#" th:href="@{ bbsBoardView.con( boardId=${ BOARD_ID }, viewPageNo=${ page.pageNo } ) }"
								th:text="${ page.pageDesc }" 
								title="" th:title="${ page.title }"
							>
								pageNo
							</a>
							<a  th:if="${ ! page.enabledPage }"
								class="" th:class="disabledPage" 
								href="#" 
								th:text="${ page.pageDesc }" 
								title="" th:title="${ page.title }"
							>
								pageNo
							</a>
						</span> 
					</div>
				</td>
			</tr>
		</tfoot>
      </table>
      
    </div>
    
    <br/>
    <div th:include="bbs_footer.html::bbs_footer"></div>

  </body>
</html>